package com.test.beanimport;

import org.springframework.context.annotation.ImportSelector;
import org.springframework.core.type.AnnotationMetadata;

import java.util.Set;

/**
 * @Aurher: QiaoHang
 * @Description:
 * @Data: 2019/9/13 9:48
 * @Modified By:
 */
public class MyImportSelector implements ImportSelector {
    /**
     *
     * @param annotationMetadata    当前类的元注解信息
     * @return
     */
    @Override
    public String[] selectImports(AnnotationMetadata annotationMetadata) {
        Set<String> types = annotationMetadata.getAnnotationTypes();
        System.out.println("输出当前类上的注解类型:");
        for (String type : types) {
            System.out.println(type);
        }
        return new String[]{"com.test.pojo.Blue","com.test.pojo.Yellow"};
    }
}
